package haizhi.fruitmall.action;

import haizhi.fruitmall.pojo.form.GoodsCategoryForm;
import haizhi.fruitmall.pojo.form.GoodsForm;
import haizhi.fruitmall.pojo.view.ResultView;
import haizhi.fruitmall.service.ListService;
import haizhi.fruitmall.util.ResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Date: 2017/12/25 10:21
 * @Author: Richard Zane
 */

@Slf4j
@Controller
@RequestMapping("/list")
public class ListController {

    @Autowired
    private ListService service;

    @RequestMapping(value = "/getHead",method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public ResultView getHead(GoodsCategoryForm form){
        return ResultUtil.getSuccess(service.getHead(form));
    }

    @RequestMapping(value = "/getTail",method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public ResultView getTail(GoodsForm form){
            return ResultUtil.getSuccess(service.getTail(form));
    }

}
